#
# Simple black-box integration tests of configuring Stdlog from a perl conf
# file and 
#
use strict;
use FindBin;
use File::Spec;
use Stdlog qw(:all);
use Test::More tests => 3;

our $tmpdir = File::Spec->tmpdir();
our $stderr;
our $msg;

# Test 1 -- configure
our $conf = do "$FindBin::Bin/conf/stdlog-conf.pl";
is(ref($conf), 'ARRAY',
    "Read configuration");

# Test 2 -- call config
eval { Stdlog->config($conf); };
ok(!$@,
    "Parse configuration");

# Test 3 -- check number of loggers
is(scalar(@{Stdlog->loggers}), 2,
    "Checking number of loggers");


# close STDERR and redirect it to the $stderr string buffer
sub reset_stderr {
    $stderr = "";
    close STDERR;
    open STDERR, '>', \$stderr;
}